/**
 */
package fUML.Semantics.CommonBehaviors.Communications;

import fUML.Semantics.CommonBehaviors.BasicBehaviors.Execution;
import fUML.Semantics.CommonBehaviors.BasicBehaviors.ParameterValue;

import org.eclipse.emf.common.util.EList;

import org.eclipse.emf.ecore.EObject;

/**
 * <!-- begin-user-doc -->
 * A representation of the model object '<em><b>Classifier Behavior Execution</b></em>'.
 * <!-- end-user-doc -->
 *
 * <!-- begin-model-doc -->
 * A classifier behavior execution executes the classifier behavior from a specific
 *                 active class. 
 * <!-- end-model-doc -->
 *
 * <p>
 * The following features are supported:
 * <ul>
 *   <li>{@link fUML.Semantics.CommonBehaviors.Communications.ClassifierBehaviorExecution#getExecution <em>Execution</em>}</li>
 *   <li>{@link fUML.Semantics.CommonBehaviors.Communications.ClassifierBehaviorExecution#getClassifier <em>Classifier</em>}</li>
 *   <li>{@link fUML.Semantics.CommonBehaviors.Communications.ClassifierBehaviorExecution#getObjectActivation <em>Object Activation</em>}</li>
 * </ul>
 * </p>
 *
 * @see fUML.Semantics.CommonBehaviors.Communications.CommunicationsPackage#getClassifierBehaviorExecution()
 * @model
 * @generated
 */
public interface ClassifierBehaviorExecution extends EObject {
	/**
	 * Returns the value of the '<em><b>Execution</b></em>' reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * <!-- begin-model-doc -->
	 * The execution of the associated classifier behavior for a certain
	 *                 object.
	 * <!-- end-model-doc -->
	 * @return the value of the '<em>Execution</em>' reference.
	 * @see #setExecution(Execution)
	 * @see fUML.Semantics.CommonBehaviors.Communications.CommunicationsPackage#getClassifierBehaviorExecution_Execution()
	 * @model required="true" ordered="false"
	 * @generated
	 */
	Execution getExecution();

	/**
	 * Sets the value of the '{@link fUML.Semantics.CommonBehaviors.Communications.ClassifierBehaviorExecution#getExecution <em>Execution</em>}' reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @param value the new value of the '<em>Execution</em>' reference.
	 * @see #getExecution()
	 * @generated
	 */
	void setExecution(Execution value);

	/**
	 * Returns the value of the '<em><b>Classifier</b></em>' reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * <!-- begin-model-doc -->
	 * The classifier whose behavior is being executed. (This must be an active
	 *                   class.)
	 * <!-- end-model-doc -->
	 * @return the value of the '<em>Classifier</em>' reference.
	 * @see #setClassifier(fUML.Syntax.Classes.Kernel.Class)
	 * @see fUML.Semantics.CommonBehaviors.Communications.CommunicationsPackage#getClassifierBehaviorExecution_Classifier()
	 * @model required="true" ordered="false"
	 * @generated
	 */
	fUML.Syntax.Classes.Kernel.Class getClassifier();

	/**
	 * Sets the value of the '{@link fUML.Semantics.CommonBehaviors.Communications.ClassifierBehaviorExecution#getClassifier <em>Classifier</em>}' reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @param value the new value of the '<em>Classifier</em>' reference.
	 * @see #getClassifier()
	 * @generated
	 */
	void setClassifier(fUML.Syntax.Classes.Kernel.Class value);

	/**
	 * Returns the value of the '<em><b>Object Activation</b></em>' container reference.
	 * It is bidirectional and its opposite is '{@link fUML.Semantics.CommonBehaviors.Communications.ObjectActivation#getClassifierBehaviorExecutions <em>Classifier Behavior Executions</em>}'.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * <!-- begin-model-doc -->
	 * The object activation that owns this classifier behavior execution.
	 * <!-- end-model-doc -->
	 * @return the value of the '<em>Object Activation</em>' container reference.
	 * @see #setObjectActivation(ObjectActivation)
	 * @see fUML.Semantics.CommonBehaviors.Communications.CommunicationsPackage#getClassifierBehaviorExecution_ObjectActivation()
	 * @see fUML.Semantics.CommonBehaviors.Communications.ObjectActivation#getClassifierBehaviorExecutions
	 * @model opposite="classifierBehaviorExecutions" transient="false" ordered="false"
	 * @generated
	 */
	ObjectActivation getObjectActivation();

	/**
	 * Sets the value of the '{@link fUML.Semantics.CommonBehaviors.Communications.ClassifierBehaviorExecution#getObjectActivation <em>Object Activation</em>}' container reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @param value the new value of the '<em>Object Activation</em>' container reference.
	 * @see #getObjectActivation()
	 * @generated
	 */
	void setObjectActivation(ObjectActivation value);

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * <!-- begin-model-doc -->
	 * // Set the classifier for this classifier behavior execution to the given
	 *                   class.
	 *  // If the given class is a behavior, set the execution to be the
	 *                   object of the object activation of the classifier behavior execution.
	 *  //
	 *                   Otherwise the class must be an active class, so get an execution object for the
	 *                   classifier behavior for the class.
	 *  // Set the input parameters for the
	 *                   execution to the given values.
	 *  // Then start the active behavior of this
	 *                   ClassifierBehaviorExecution object, which will execute the execution object on a
	 *                   separate thread of control.
	 *  
	 *  // Debug.println("[execute]
	 *                   Executing behavior for " + classifier.name + "...");
	 *  
	 *                   this.classifier = classifier;
	 *  Object_ object =
	 *                   this.objectActivation.object;
	 *  
	 *  if (classifier instanceof
	 *                   Behavior) {
	 *  this.execution = (Execution)object;
	 *  } else
	 *                   {
	 *  this.execution =
	 *                   object.locus.factory.createExecution(classifier.classifierBehavior,
	 *                   object);
	 *  }
	 *  
	 *  if (inputs != null) {
	 *  for (int i =
	 *                   0; i < inputs.size(); i++) {
	 *  ParameterValue input =
	 *                   inputs.getValue(i);
	 *  this.execution.setParameterValue(input);
	 *                   }
	 *  }
	 *  
	 *  _startObjectBehavior();
	 *  
	 * <!-- end-model-doc -->
	 * @model classifierRequired="true" classifierOrdered="false" inputsMany="true" inputsOrdered="false"
	 * @generated
	 */
	void execute(fUML.Syntax.Classes.Kernel.Class classifier, EList<ParameterValue> inputs);

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * <!-- begin-model-doc -->
	 * // Terminate the associated execution.
	 *  // If the execution is not
	 *                   itself the object of the object activation, then destroy it.
	 *  
	 *                   //Debug.println("[terminate] Terminating behavior for " + classifier.name +
	 *                   "...");
	 *  
	 *  this.execution.terminate();
	 *  
	 *  if
	 *                   (this.execution != this.objectActivation.object) {
	 *                   this.execution.destroy();
	 *  }
	 *  
	 *  
	 * <!-- end-model-doc -->
	 * @model
	 * @generated
	 */
	void terminate();

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @model
	 * @generated
	 */
	void _startObjectBehavior();

} // ClassifierBehaviorExecution
